using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;

namespace EC.TSVNVsPackage
{
    class Solution
    {
        IVsSolution vsSolution;

        public Solution(IVsSolution vsSolution) {
            if (vsSolution == null)
                throw new ArgumentNullException("vsSolution");

            this.vsSolution = vsSolution;
        }

        public bool IsDirty {
            get {
                object isDirty = false;
                vsSolution.GetProperty((int)__VSPROPID.VSPROPID_IsSolutionDirty, out isDirty);
                return (bool)isDirty;
            }
        }

        public bool IsOpened {
            get {
                object isOpened = false;
                vsSolution.GetProperty((int)__VSPROPID.VSPROPID_IsSolutionOpen, out isOpened);
                return (bool)isOpened;
            }
        }

        public string Folder {
            get {
                object path;
                vsSolution.GetProperty((int)__VSPROPID.VSPROPID_SolutionDirectory, out path);
                return (string)path;
            }
        }
    }
}
